package com.puchi.sdkdemo.app.home.model;

import android.app.Application;
import androidx.annotation.NonNull;
import com.orhanobut.logger.Logger
import com.puchi.sdkdemo.app.came.activity.GameActivity
import com.puchi.sdkdemo.app.cash.activity.CashActivity
import com.puchi.sdkdemo.app.game.activity.GamesActivity
import com.zalyyh.mvvm.base.BaseViewModel;
import com.puchi.sdkdemo.app.home.activity.MainActivity;
import com.puchi.sdkdemo.databinding.ActivityMainBinding;
import com.zalyyh.mvvm.binding.data.command.BindingAction
import com.zalyyh.mvvm.binding.data.command.BindingCommand


class MainViewModel(application: Application) : BaseViewModel(application) {
    var yThis: MainViewModel = this
    var activity: MainActivity? = null
    var binding: ActivityMainBinding? = null


    fun setData(a: MainActivity, b: ActivityMainBinding) {
        activity = a;
        binding = b;

    }

    var game = BindingCommand<String>(BindingAction {
        startActivity(GamesActivity::class.java)
    })
    var guan = BindingCommand<String>(BindingAction {
        startActivity(GameActivity::class.java)
    })
    var ceshi = BindingCommand<String>(BindingAction {
        startActivity(CashActivity::class.java)
    })

    fun nullceshi() :String{
        var a:String? = null
        //Logger.e("null____ceshi"+a!!.length)
        return "测试Null"
    }
}